package com.aabte.spring.service;

import com.aabte.spring.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Daniel
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Transactional(rollbackFor = Exception.class)
    public void insetUser(){
        userDao.insert();
        System.out.println("insert user success.");
        int rs = 10 / 0;
    }

}
